<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue生命周期-钩子函数</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>

</head>
<body>
<div id="app">
    <h3 >{{msg}}</h3>
</div>



<script>

    var app = new Vue({
        el: '#app',
        data: {
            msg:"hello",
            a:1
        },
        methods:{

        },
        created: function () {
            // `this` 指向 vm 实例
            console.log('a is: ' + this.a);
            this.a=2

        }
    });

</script>
</body>
</html>
